# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[return context['menu'].type in ('video_image', 'image', 'video', 'audio')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb771fccc>}
nname: 257
n 257(None)[return None
]:
	i: 122(), 183(), 233()
	o: 

nname: 233
n 233(None)[k.hide()
context['parent'].show_menu()
]:
	i: 88(), 231(AE)
	o: 257()

nname: 231
n 231(None)[]:
	i: 172(f)
	o: 233(AE)

nname: 183
n 183(None)[MessageWindow(text=_('Filename %s already exists') % name, title=title).show(timeout=5)
]:
	i: 172(t)
	o: 257()

nname: 172
n 172(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 112(f)
	o: 183(t), 231(f)

nname: 122
n 122(None)[MessageWindow(text=_('Error while creating playlist'), title=_('Error')).show(timeout=5)
]:
	i: 112(t)
	o: 257()

nname: 112
n 112(<dummy_ex3> EXC_MATCH CreateContainerError)[]:
	i: 85(except)
	o: 122(t), 172(f)

nname: 88
n 88(None)[mlist.create_playlist(context['parent'], name)
]:
	i: 85(try)
	o: 233()

nname: 85
n 85(None)[]:
	i: 33(), 84()
	o: 88(try), 112(except)

nname: 84
n 84(None)[]:
	i: 0(t)
	o: 85()

nname: 33
n 33(None)[message = _('That name is not valid. Choose another one.')
MessageWindow(message, title, button=None).show(timeout=5)
return None
]:
	i: 0(f)
	o: 85()

nname: 0
n 0(name)[name = k._text.strip()
title = _("Can't use that name")
]:
	i: 
	o: 33(f), 84(t)

nname: 257
n 257(None)[return None
]:
	i: 122(), 183(), 233(), 172(f)
	o: 

nname: 183
n 183(None)[MessageWindow(text=_('Filename %s already exists') % name, title=title).show(timeout=5)
]:
	i: 172(t)
	o: 257()

nname: 172
n 172(<dummy_ex3> EXC_MATCH FilenameExistsError)[]:
	i: 112(f)
	o: 183(t), 257(f)

nname: 122
n 122(None)[MessageWindow(text=_('Error while creating playlist'), title=_('Error')).show(timeout=5)
]:
	i: 112(t)
	o: 257()

nname: 112
n 112(<dummy_ex3> EXC_MATCH CreateContainerError)[]:
	i: 0(except)
	o: 122(t), 172(f)

nname: 233
n 233(None)[k.hide()
context['parent'].show_menu()
]:
	i: 88(), 231(AE)
	o: 257()

nname: 88
n 88(None)[mlist.create_playlist(context['parent'], name)
]:
	i: 0(try)
	o: 233()

nname: 0
n 0(None)[name = k._text.strip()
title = _("Can't use that name")
if not name:
	message = _('That name is not valid. Choose another one.')
	MessageWindow(message, title, button=None).show(timeout=5)
	return None
]:
	i: 
	o: 88(try), 112(except)

nname: 257
n 257(None)[return None
]:
	i: 112(), 233()
	o: 

nname: 112
n 112(None)[except CreateContainerError:
	MessageWindow(text=_('Error while creating playlist'), title=_('Error')).show(timeout=5)
except:
	except FilenameExistsError:
		MessageWindow(text=_('Filename %s already exists') % name, title=title).show(timeout=5)
]:
	i: 0(except)
	o: 257()

nname: 233
n 233(None)[k.hide()
context['parent'].show_menu()
]:
	i: 88(), 231(AE)
	o: 257()

nname: 88
n 88(None)[mlist.create_playlist(context['parent'], name)
]:
	i: 0(try)
	o: 233()

nname: 0
n 0(None)[name = k._text.strip()
title = _("Can't use that name")
if not name:
	message = _('That name is not valid. Choose another one.')
	MessageWindow(message, title, button=None).show(timeout=5)
	return None
]:
	i: 
	o: 88(try), 112(except)

self.nodes: {0: <unpyclib.structure.node instance at 0xb772806c>, 231: <unpyclib.structure.node instance at 0xb772846c>, 233: <unpyclib.structure.node instance at 0xb77284ec>, 112: <unpyclib.structure.node instance at 0xb772824c>, 88: <unpyclib.structure.node instance at 0xb77281ec>, 257: <unpyclib.structure.node instance at 0xb772856c>}
nname: 188
n 188(None)[]:
	i: 163(), 187()
	o: 

nname: 187
n 187(None)[]:
	i: 0&143(f)
	o: 188()

nname: 163
n 163(None)[context['menu'].contextual_windows.append(kbd)
]:
	i: 0&143(t)
	o: 188()

nname: 0&143
n 0&143(context['menu'] and hasattr(context['menu'], 'contextual_windows'))[from pygui.window import KeyboardWindow, MessageWindow
mlist = markerlists().get(context['menu'].universe)
def __create(k):
	name = k._text.strip()
	title = _("Can't use that name")
	if not name:
		message = _('That name is not valid. Choose another one.')
		MessageWindow(message, title, button=None).show(timeout=5)
		return None

name = context['parent'].get_free_child_name(_('Playlist'))
kbd = KeyboardWindow(_('Playlist name'), text=name, confirm_action=__create)
kbd.show()
]:
	i: 
	o: 163(t), 187(f)

nname: 0&143
n 0&143(None)[from pygui.window import KeyboardWindow, MessageWindow
mlist = markerlists().get(context['menu'].universe)
def __create(k):
	name = k._text.strip()
	title = _("Can't use that name")
	if not name:
		message = _('That name is not valid. Choose another one.')
		MessageWindow(message, title, button=None).show(timeout=5)
		return None

name = context['parent'].get_free_child_name(_('Playlist'))
kbd = KeyboardWindow(_('Playlist name'), text=name, confirm_action=__create)
kbd.show()
if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
	context['menu'].contextual_windows.append(kbd)
]:
	i: 
	o: 

self.nodes: {'0&143': <unpyclib.structure.node instance at 0xb77257cc>}
nname: 0
n 0(None)[from __future__ import absolute_import
from wymedia.wmplus import BrowseError, CreateContainerError, FilenameExistsError
from pygui.item.mediaitem import Playlist
from pygui.markerlist import markerlists
caption = 'Create a playlist with the marked items'
def is_compatible(context):
	return context['menu'].type in ('video_image', 'image', 'video', 'audio')

def execute(context):
	from pygui.window import KeyboardWindow, MessageWindow
	mlist = markerlists().get(context['menu'].universe)
	def __create(k):
		name = k._text.strip()
		title = _("Can't use that name")
		if not name:
			message = _('That name is not valid. Choose another one.')
			MessageWindow(message, title, button=None).show(timeout=5)
			return None

	name = context['parent'].get_free_child_name(_('Playlist'))
	kbd = KeyboardWindow(_('Playlist name'), text=name, confirm_action=__create)
	kbd.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(kbd)

]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb771f7ec>}
from __future__ import absolute_import
from wymedia.wmplus import BrowseError, CreateContainerError, FilenameExistsError
from pygui.item.mediaitem import Playlist
from pygui.markerlist import markerlists
caption = 'Create a playlist with the marked items'
def is_compatible(context):
	return context['menu'].type in ('video_image', 'image', 'video', 'audio')

def execute(context):
	from pygui.window import KeyboardWindow, MessageWindow
	mlist = markerlists().get(context['menu'].universe)
	def __create(k):
		name = k._text.strip()
		title = _("Can't use that name")
		if not name:
			message = _('That name is not valid. Choose another one.')
			MessageWindow(message, title, button=None).show(timeout=5)
			return None

	name = context['parent'].get_free_child_name(_('Playlist'))
	kbd = KeyboardWindow(_('Playlist name'), text=name, confirm_action=__create)
	kbd.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(kbd)

